#ifndef _BASE_H
#define _BASE_H

#include <iostream>
#include <time.h>
#include <stdlib.h>
#include <map>
#include <vector>

namespace type
{
	/// 基本数据类型
	typedef unsigned char uint8;
	typedef char int8;
	typedef unsigned short uint16;
	typedef short int16;
	typedef unsigned int uint32;
	typedef int int32;

	/// 性别枚举
	enum
	{
		SEX_MALE = 0,				/// 男性
		SEX_FEMALE,			/// 女性
		SEX_OTHER,			/// 其他(春哥？？)
	};

	/// 情绪
	enum
	{
		EMOTION_CRY = 0,					/// 哭
		EMOTION_FADE,						/// 平淡
		EMOTION_HAPPY,					/// 高兴
		EMOTION_GRIEF,						/// 伤心
		EMOTION_ANGRY,					/// 生气
	};

	static int randBetween(int min, int max)
	{
		if(min == max) return min;
		else if(min < max)
			return min + (((double)max - (double)min + 1.0)*rand()) / (RAND_MAX+1.0);
		else return max + (((double)min - (double)max + 1.0)*rand()) / (RAND_MAX+1.0);
	}
};

#endif
